# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Jelle van der Waa <jelle@archlinux.org>

pkgname=python-jellyfish
pkgver=0.9.1
pkgrel=3
pkgdesc='A python library for doing approximate and phonetic matching of strings'
arch=(loong64 x86_64)
url='https://github.com/jamesturk/jellyfish'
license=(BSD)
depends=(python)
makedepends=(
  git
  python-setuptools
)
_tag=f31b9bd8c06dd764023a8cf0a82319c0ce20a0bb
source=(
  git+https://github.com/jamesturk/jellyfish.git#tag=${_tag}
  git+https://github.com/jamesturk/cjellyfish.git
)
sha256sums=(
  SKIP
  SKIP
)

prepare() {
  cd jellyfish
  for submodule in cjellyfish; do
    git submodule init ${submodule}
    git config submodule.${submodule}.url ../${submodule}
    git -c protocol.file.allow=always submodule update ${submodule}
  done
  sed 's/0.9.0/0.9.1/' -i setup.py
}

pkgver() {
  cd jellyfish
  git describe --tags | sed 's/^v//'
}

build() {
  cd jellyfish
  python setup.py build
}

package() {
  cd jellyfish
  python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
  install -Dm 644 LICENSE -t "${pkgdir}"/usr/share/licenses/python-jellyfish/
}

# vim: ts=2 sw=2 et:
